package com.javabasic.algorithm.leetcode;

import java.util.HashMap;
import java.util.Map;

/**
 * @author xiongmin
 * @version 0.0.1
 * @description Created by work on 2021/11/17 10:02 下午
 * @see
 */
public class MaximumProductOfWordLengths {

    public int maxProduct(String[] words) {
        PreTree root = new PreTree(-1), preTemp;
        for (String word : words) {
            int len = word.length();
            preTemp = root;
            for (int i = 0; i < len; i++) {
                int value = word.charAt(i) - 'a';
                PreTree preTree = new PreTree(value);
                preTemp.subTree.put(value,preTree);
                preTemp = preTree;
            }
        }

        return -1;
    }
}

class PreTree {
    public Map<Integer,PreTree> subTree;
    public Integer value;

    public PreTree(Integer value) {
        this.subTree = new HashMap<>(2);
        this.value = value;
    }
}
